package com.wanwu.channel.common.enums;

/**
 * @author zhy
 * @date 2020-1-4
 * @descrption 支付宝的收款类型枚举类
 */
public enum AlipayAppPaymentTypeEnums {

    RED_PACKET_SETTLEMENT_ADVANCE_RECEIPT("01", "红包结算金预收款"),
    RED_PACKET_SETTLEMENT("02", "红包结算金"),
    REMIND_RECEIPT("03", "提醒收款"),
    AUTO_DELIVER_GOODS("04", "自动发货商品"),
    BUY_GOODS("1", "商品购买"),
    BUY_SERVICE("2", "服务购买"),
    ONLINE_AUCTION("3", "网络拍卖"),
    DONATE("4", "捐赠"),
    POSTAGE_COMPENSATION("5", "邮费补偿"),
    BONUS("6", "奖金"),
    BUY_FUND("7", "基金购买"),
    BUY_AIR_TICKET("8", "机票购买"),
    AA("9", "收AA款"),
    GROUP_BUYING("10", "团购"),
    ELECTRONIC_TICKET("11", "电子客票"),
    LOTTERY("12", "彩票"),
    AUCTION("13", "拍卖"),
    PHONE_PAY_TYPE("14", "手机支付类型"),
    FLOWER_GIFT("15", "鲜花礼品"),
    AGENT_ELECTRONIC_TICKET("16", "代理商电子客票"),
    PARTY_MEMBERSHIP_DUES("17", "党费"),
    FOREIGN_EXCHANGE("18", "外汇"),
    AUTO_RECHARGE("19", "自动直充"),
    OVERSEAS_RECEIPT_FOR_REFUND("20", "境外收单退款"),
    IMMEDIATE_REFUND("21", "即时到账退款"),
    BUSINESS_MARGIN("22", "业务保证金"),
    TO_SEND_GIFT("24", "送礼金"),
    PAY_RENT("25", "交房租"),
    MOTOPAY("26", "motopay类型"),
    SHOPPING_CART_PAY("23", "购物车支付"),
    GROUP_PURCHASE_GUARANTEED_TRANSACTION_PAYMENT("27", "团购担保交易付款"),

    ;

    private String value;
    private String desc;

    AlipayAppPaymentTypeEnums(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static AlipayAppPaymentTypeEnums getPaymentTypeEnum(String value) {

        for (AlipayAppPaymentTypeEnums type : AlipayAppPaymentTypeEnums.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }
}
